package com.plugin.core.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 库存表
 *
 * @author plugin
 * @since 2025-07-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("elder_stock")
public class ElderStock implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 物品名字
     */
    @TableField("item_name")
    private String itemName;

    /**
     * 物品序列号
     */
    @TableField("item_number")
    private String itemNumber;

    /**
     * 批次号
     */
    @TableField("batch_number")
    private Long batchNumber;

    /**
     * 条形码
     */
    @TableField("barcode")
    private String barcode;

    /**
     * 1采购入库;2调拨入库;3退货入库
     */
    @TableField("stock_in_reason")
    private Integer stockInReason;

    /**
     * 1领用出库2调拨出库 3退货出库 4报废出库, 5其他出库
     */
    @TableField("stock_out_reason")
    private Integer stockOutReason;

    /**
     * 库存数量
     */
    @TableField("quantity")
    private Integer quantity;

    /**
     * 领用部门
     */
    @TableField("recipient_department")
    private String recipientDepartment;

    /**
     * 领用人
     */
    @TableField("recipient_name")
    private String recipientName;

    /**
     * 单价
     */
    @TableField("unit_price")
    private BigDecimal unitPrice;

    /**
     * 最近盘点日期
     */
    @TableField("last_check_date")
    private LocalDate lastCheckDate;

    /**
     * 1.入库待审核2-审核通过已入库;3-出库待审核4-审核通过已出库
     */
    @TableField("stock_state")
    private Integer stockState;

    /**
     * 供应商
     */
    @TableField("supplier_name")
    private String supplierName;

    /**
     * 供应商电话
     */
    @TableField("supplier_mobile")
    private String supplierMobile;

    /**
     * 供应商地址
     */
    @TableField("supplier_address")
    private String supplierAddress;

    /**
     * 仓库
     */
    @TableField("warehouse")
    private String warehouse;

    /**
     * 操作人
     */
    @TableField("create_by")
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 入库时间
     */
    @TableField("stock_in_date")
    private LocalDateTime stockInDate;

    /**
     * 出库时间
     */
    @TableField("stock_out_date")
    private LocalDateTime stockOutDate;

    /**
     * 是否删除：0-未删除，1-已删除
     */
    @TableField("del")
    @TableLogic
    private Integer del;
}
